package cn.design;

import cn.design.realize.ColleaguePerson;
import cn.design.realize.ConcreteColleagueFangDong;
import cn.design.realize.ConcreteColleagueZuHu;
import cn.design.realize.ConcreteMediator;

/**
 * @author dlq
 * @description
 * @date 2020/10/13 9:52
 * @since 1.0
 */
public class MediatorClientDemo {
    public static void main(String[] args) {

        //小明需要找房子，先找到中介，然后中介告知给 AA房东\

        //1. 定义具体中介
        ConcreteMediator mediator = new ConcreteMediator();

        //2. 定义 房东 和租户
        ConcreteColleagueFangDong fangDong = new ConcreteColleagueFangDong("AA",mediator);
        ConcreteColleagueZuHu zuHu = new ConcreteColleagueZuHu("小明",mediator);

        mediator.setFangDong(fangDong);
        mediator.setZuHu(zuHu);

        zuHu.constact("找一个一套三的房子");
        fangDong.constact("我这里有，你确定要租么");

    }
}
